<?php
/**
 * Created by PhpStorm.
 * User: HP
 * Date: 2021/6/8
 * Time: 14:26
 */

namespace app\common\model;

use think\Model;
class Doctor extends Model
{
    //  连接数据库
    protected $connection = 'hospital';
    //  自动写入时间戳字段
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';


    //  根据id获取用户信息
    public function fetchInfoById($id, $field = '*')
    {
        return $this->field($field)->find($id);
    }

    //  根据where条件查询用户信息
    public function fetchInfoByWhere($where, $field = ['*'])
    {
        return $this->where($where)->field($field)->find();
    }
}